<?php

class SJB_GeoType extends SJB_Type
{
	function SJB_GeoType($property_info)
	{
		parent::SJB_Type($property_info);
		$this->default_template = 'geo.tpl';
	}

	function isValid()
	{
		if ($this->property_info['hidden'] || SJB_LocationManager::doesLocationExist($this->property_info['value'])) {
			return true;
		}
		return 'LOCATION_NOT_EXISTS';
	}

    function getKeywordValue()
	{
		return $this->property_info['value'];
	}

	public static function getFieldExtraDetails()
	{
		return array(
			array(
				'id'		=> 'use_autocomplete',
				'caption'	=> 'Use Autocomplete',
				'type'		=> 'boolean',
				'value'		=> '',
                'is_system' => true,
				),
		);
	}
	
	function getSQLValue()
	{
		return "'". SJB_DB::quote($this->property_info['value']) ."'";
	}
}
